/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Control;

import DataModels.EmpFileOp;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import views.BaseManagement;
import views.addPage;

/**
 *
 * @author TOSHIBA
 */
public class employeeController {

    public employeeController() {
        
         BaseManagement baseManagementEmployee =new BaseManagement();
          
          baseManagementEmployee.setVisible(true);
          
           baseManagementEmployee.btn1.setText("admvjjkjjjkjjgkkgjkjd");
           baseManagementEmployee.btn1.addActionListener(new ActionListener() {

                  @Override
                  public void actionPerformed(ActionEvent e) {
                     // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                       baseManagementEmployee.setVisible(false);
                      addPage pageEmployee =new addPage();
                      pageEmployee.setVisible(true);
                      pageEmployee.jButton1.addActionListener(new ActionListener() {

                           @Override
                           public void actionPerformed(ActionEvent e) {
                              // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                           String name1 =    pageEmployee.jTextField1.getText();
               String Email = pageEmployee.jTextField2.getText();
                      System.out.println("the got mail "+ Email+ " name " + name1 );
                           EmpFileOp FO = new EmpFileOp();
                           FO.writeToFile(name1 + "#" + Email ) ;
                           }
                       });
                      
             
               
                  }
              });
       baseManagementEmployee.btn2.setText("edit");
        baseManagementEmployee.btn3.setText("delete");
    }
    
    
}
